With the popularization and application of the network, the network security problems such as network attack, virus file propagation, and junk mail proliferation are becoming increasingly serious. Gateway apparatuses such as a firewall, a virus gateway, and a mail gateway emerge to meet the urgent demands of operators and enterprise users. In order to restore the application data of a data stream, the gateway apparatus first needs to buffer the application data of the data stream. In a process of buffering the application data, a proxy gateway serves as both a client and a server, which communicates with a real server and a real client respectively, so as to intercept and buffer the application data. In this process, the real client and the real server generally do not know the true identities of the peers with which the real client and the real server interact to transmit data. In a process of establishing a connection between the client and the server, the gateway apparatus generally begins to perform full proxy during three times handshake, the client establishes a connection with a proxy server of the gateway apparatus, and a proxy client of the gateway apparatus establishes a connection with the server.
During the implementation of the present invention, the inventor finds that, in the conventional art, the proxy client may figure out whether the server is in an active state only after establishing the connection with the server through initiating the three times handshake. Also, after the client establishes the connection with the server, if the server is in a turn-off state, the connection between the proxy client and the server is disconnected soon after being established, thereby interrupting the user experience.